<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/7/27
 * Time: 9:25
 */

namespace Admin\Controller;
use Think\Page;

class EditLogController extends AdminController{
    public function __construct(){
        parent::__construct();
    }

    public function log_show(){
        $name=I('get.nickname');
        if(!empty($name)){
        $userdata=M('follow')->where(array('nickname'=>array('like','%'.$name.'%')))->select();
            if($userdata){
                foreach($userdata as $val){
                    $id[]=$val['id'];
                }
                $where['id']=array('in',$id);
            }
        }
        $Model=M('edit_level_log');
        $count=$Model->where($where)->count();
        $page=new Page($count,20);
        $showdata=M('edit_level_log')->where($where)->order('id desc')->limit($page->firstRow.','.$page->listRows)->select();
        $this->assign('showdata',$showdata);
        $this->assign('page',$page);
        $this->assign('name',$name);
        $this->display();
    }
}